package com.itheima.test.test16;

//创建一个学生类继承Person类
//属性: 学号(id)
//行为: 学习(work) – 重写父类的干活方法

public class Student extends Person {
    private String id;

    public Student(String id) {
        this.id = id;
    }

    public Student(String name, int age, String id) {
        super(name, age);
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public Student() {
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public void work() {
        System.out.println("学习(work) – 重写父类的干活方法");
    }

    @Override
    public String toString() {
        return "id: " + this.id + "   姓名: " + super.getName() + "    学号: " + this.id + "  年龄: " + super.getAge();
    }
}
